package com.holyant.goods.enums;

/**
 * @author zgx *
 * @date 2022年06月24日 11:46
 */
public enum GoodsGuidePriceAuditStatusEnum {


    DRAFT(0, "草稿"),
    WAIT_PRE_AUDIT(10, "待审核"),
    WAIT_RE_AUDIT(20, "待复审"),
    AUDITED(30, "已审核");

    private final Integer code;
    private final String name;

    GoodsGuidePriceAuditStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {

        return name;
    }

    public static String getNameByCode(Integer code) {
        for (GoodsGuidePriceAuditStatusEnum item : GoodsGuidePriceAuditStatusEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getName();
            }
        }
        return "";
    }

    public static Integer getCodeByName(String name) {
        for (GoodsGuidePriceAuditStatusEnum item : GoodsGuidePriceAuditStatusEnum.values()) {
            if (item.getName().equals(name)) {
                return item.code;
            }
        }
        return null;
    }
}
